﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="IDatabaseHelper.cs" company="CodePlex">
//   Copyright © CodePlex 2012
// </copyright>
// <summary>
//   Defines the IDatabaseHelper type.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace DataFramework.Interfaces
{
    using System.Data;

    /// <summary>
    /// Interface to define what items a Database Helper shall provide.
    /// </summary>
    internal interface IDatabaseHelper
    {
        /// <summary>
        /// Gets the query parameter prefix.
        /// </summary>
        /// <value>The query parameter prefix.</value>
        char QueryParameterPrefix { get; }

        /// <summary>
        /// Creates the parameter.
        /// </summary>
        /// <param name="columnName">Name of the column.</param>
        /// <param name="columnType">Type of the column.</param>
        /// <param name="value">The value.</param>
        /// <returns>An object that subscribes to the IDataParameter interface.</returns>
        IDataParameter CreateParameter(string columnName, DbType columnType, object value);

        /// <summary>
        /// Converts the value to db safe value.
        /// </summary>
        /// <param name="value">The value.</param>
        /// <returns>An object that contains the value but is safe for the database.</returns>
        object ConvertValueToDbSafeValue(object value);
    }
}